﻿@{
ViewBag.Title = "单日票据审核";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section mystyle{

}

<!-- search -->
<div class="content margin-top-20" id="search-box">
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <div class="box padding-top-10 padding-bottom-10">
          <form class="form-inline">
            <div class="form-group">
              <label for="" class="margin-left-10">项目名称</label>
              <input type="search" name="search" id="search" class="form-control margin-left-10">


            </div>

            <div class="form-group">
              <label for="" class="margin-left-10">时间</label>
              <div class="datepk-box c-select vm w240 pop-style vm margin-left-10">
                <input type="text" name="" id="" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>

              <span class="padding-left-10 padding-right-10 vm">至</span>

              <div class="datepk-box c-select vm w240 pop-style vm">
                <input type="text" name="" id="" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>
              <!--<div class="input-group input-daterange search-date">
                <input type="text" class="form-control" name="" id="">
                <span class="input-group-addon">至</span>
                <input type="text" class="form-control" name="" id="">
              </div>-->

              <label for="search"><span class="glyphicon glyphicon-search margin-10 font-16"></span></label>
            </div>

          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- table -->
<div class="padding-top-10 padding-bottom-10 margin-top-20">
  <div class="container">
    <div class="row">

      <div id="table" class="col-sm-12 margin-top-20">
        <table class="table text-center" id="listTable"></table>
      </div>

      <div class="col-sm-12 clearfix">
        <!--<div class="pages"></div>-->
        <p class="float-left">总条数：<span id="totalRow">20</span></p>

        <div class="table-pagination float-right line-height-34 margin-left-10 text-center" id="pages"></div>

        <div class="float-right">
          <form class="form-inline">
            <span>显示条数：</span>
            <select name="pageSize" id="pageSize" class="form-control">
              <option value="10">10</option>
              <option value="20">20</option>
              <option value="30">30</option>
            </select>
          </form>
        </div>


      </div>
    </div>
  </div>
</div>

<script id="l23List" type="text/html">
  <thead>
  <tr>
    <th></th>
    <th>项目名称</th>
    <th>报销日期</th>
    <th>提报日期</th>
    <th>状态</th>
    <th>报销人</th>
    <th>操作</th>
  </tr>
  </thead>
  <tbody>
  {{each $data}}
  <tr>
    <td>{{$index + 1}}</td>
    <td>{{$value.ProjectName}}</td>
    <td>{{$value.ApplyDate}}</td>
    <td>{{$value.SubmitTime}}</td>
    <td>{{$value.State}}</td>
    <td>{{$value.UserName}}</td>
    <td>
      <button type="button" class="btn btn-success margin-left-10 view">查看详单</button>
    </td>
  </tr>
  {{/each}}
  </tbody>

</script>

<!-- 单日票据审核 -->
<div class="modal fade" id="detailList" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content padding-10 w700">
      <div class="text-right">
        <a class="close-pop" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span></a>
      </div>
      <div id="viewDetail"></div>
    </div>
  </div>
</div>

<div class="modal fade" id="rejectReason" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content padding-10 w700">
      <div class="text-right">
        <a class="close-pop" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span></a>
      </div>
      <form class="form-horizontal">
        <div class="form-group">
          <label for="" class="col-sm-3 control-label">驳回理由</label>
          <div class="col-sm-7 line-height-34">
            <textarea name="" id="rejectDetail" class="form-control"></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-3 col-sm-offset-3">
            <button type="button" id="rejectConfirm" class="btn btn-danger btn-block">驳回</button>
          </div>
          <div class="col-sm-3">
            <button type="button" id="returnReject" class="btn btn-primary btn-block">返回</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

<script id="detail" type="text/html">
  <div class="row">
    <div class="col-sm-12"><h3 class="margin-10 text-center">{{BrandName}} - {{TypeName}} - {{SubmitTime}} - {{StageName}}</h3></div>
  </div>
  <form class="form-horizontal">
    <div class="form-group">
      <label for="" class="col-sm-3 col-sm-offset-2 control-label">报销日期</label>
      <div class="col-sm-3 line-height-34">{{SubmitTime}}</div>
    </div>

    <div class="form-group">
      <label for="" class="col-sm-3 col-sm-offset-2 control-label">报销人</label>
      <div class="col-sm-3 line-height-34">{{UserName}}</div>
    </div>

    {{each data as value i}}
    <div class="form-group">
      <label for="" class="col-sm-3 control-label">{{value.CostType}}</label>
      <div class="col-sm-3 line-height-34">总计：{{value.CostMoney}}元</div>
      <div class="col-sm-3 line-height-34">费用说明</div>
      <div class="col-sm-3 line-height-34">{{value.CostExplain}}</div>
    </div>
    {{/each}}

    <div class="form-group">
      <div class="col-sm-3 col-sm-offset-3">
        <img src="{{data[0].InvoiceURL}}" alt="" class="max-width-100">
        <p><a href="{{data[0].InvoiceURL}}">下载图片</a></p>
      </div>
    </div>

    <div class="form-group">
      <ul class="step-list">
        {{each data2 as value i}}
        <li class="row">
          <div class="col-sm-6">{{value.TriggerMan + value.IncidentContent}}</div>
          <div class="col-sm-6">{{value.CreateTime}}</div>
        </li>
        {{/each}}
        <!--<li class="row">
          <div class="col-sm-6">提交申请</div>
          <div class="col-sm-6">{{data[0].SubmitTime}}</div>
        </li>
        {{if data[0].RunAuditTime}}
        <li class="row">
          <div class="col-sm-6">项目运营审核</div>
          <div class="col-sm-6">{{data[0].RunAuditTime}}</div>
        </li>
        {{/if}}
        {{if data[0].PMAuditTime}}
        <li class="row">
          <div class="col-sm-6">项目经理审核</div>
          <div class="col-sm-6">{{data[0].PMAuditTime}}</div>
        </li>
        {{/if}}-->
      </ul>
    </div>
    <!--{{if data[0].State !== '提交申请'}}
    <div class="form-group">
      <div class="col-sm-2 col-sm-offset-5 text-center">{{data[0].State}}</div>
    </div>
    {{/if}}-->

    {{each data2 as value i}}
    {{if value && value.IncidentContent.indexOf('驳回') !== -1 }}
    <div class="form-group">
      <div class="col-sm-2 col-sm-offset-5">
        {{value.Explain}}
      </div>
    </div>
    {{/if}}
    {{/each}}

    {{if teacher && !run && !reject}}
    <div class="form-group">
      <div class="col-sm-3 col-sm-offset-3">
        <button type="button" id="pass" class="btn btn-success btn-block">通过</button>
      </div>
      <div class="col-sm-3">
        <button type="button" id="reject" class="btn btn-danger btn-block">驳回</button>
      </div>
    </div>
    {{/if}}
  </form>
</script>

@section myscript{
<script src="~/Content/js/bind33.js"></script>
}